<?php
/**
 * @author neeke@php.net
 * Date: 15-11-2 下午6:13
 */

class configs_lang_Module
{
    const FLASH_XML = 'flash_xml'; //xml
    const API = "api"; //api
    const DOCKER = "docker"; //docker
    const UC_PERSONAL_SETTING = "uc_person_set"; //用户中心 个人设置
    const UC_ALERT_SETTING = "uc_alert_set"; //用户中心 通知设置
    const UC_ACCOUNT_MANAGE = 'uc_account_manage'; //用户中心 账户管理
    const UC_PROD_SETTING = 'uc_prod_set';//用户中心 产品设置
    const HEADER_TITLE = 'hd_title';//公共的header
    const CUSTOM_MONITOR = 'custom_monitor';// 监控 自定义监控
    const MONITOR_API = "monitor_api";
    const MONITOR_SERVER = 'monitor_server';// 服务器监控
    const MONITOR_SERVICE = 'monitor_service';// 服务性能监控
    const MONITOR_POINT = "monitor_point"; //监控点
    const MONITOR_SITE = "monitor_site"; //监控 网站监控
    const TASK_CREATE = 'task_create'; //任务 创建编辑任务
    const REPORT_SLA = 'report_sla'; //报表中心sla
    const REPORT_ALERT = 'report_alert'; //报表中心 告警
    const INTERNAL_COLLECTOR  = 'internal_collector'; //概览 内网采集器
    const MONITOR_CLOUD_HOST  = 'monitor_cloud_host'; //概览 云主机监控
    const REPORT_OVERVIEW  = 'report_ov';   //报表中心 仪表盘
    const REPORT_VIEW      = 'report_v';    //报表中心 视图
    const REPORT_COMPARE = 'report_compare';//报表中心　对比分析报告
    const OVERVIEW ='overview';//概览
    const CONFIG  = "config";  //配置文件
    const ECHARTS = 'echarts';//echarts
    const common = 'common';//公共
    const YUNZHIHUI = 'yunzhihui';//公共

    public static function getLangModules()
    {
        return array(
            self::FLASH_XML,
            self::API,
            self::DOCKER,
            self::UC_PERSONAL_SETTING,
            self::UC_ALERT_SETTING,
            self::UC_ACCOUNT_MANAGE,
            self::UC_PROD_SETTING,
            self::CUSTOM_MONITOR,
            self::HEADER_TITLE,
            self::MONITOR_SERVER,
            self::MONITOR_SERVICE,
            self::MONITOR_POINT,
            self::MONITOR_API,
            self::MONITOR_SITE,
            self::TASK_CREATE,
            self::REPORT_SLA,
            self::REPORT_ALERT,
            self::REPORT_OVERVIEW,
            self::REPORT_VIEW,
            self::INTERNAL_COLLECTOR,
            self::MONITOR_CLOUD_HOST,
            self::REPORT_COMPARE,
            self::OVERVIEW,
            self::CONFIG,
            self::ECHARTS,
            self::common,
            self::YUNZHIHUI,
        );
    }
}

$aDomains = configs_lang_Module::getLangModules();
foreach($aDomains as $domain)
{
    bindtextdomain($domain, 'locales');
    bind_textdomain_codeset($domain ,  'UTF-8' );
}

setlocale(LC_ALL, 'en_US' . '.utf8');

var_dump(dgettext(configs_lang_Module::HEADER_TITLE,'专业版'));